package com.example.menu;

import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.gamemenu.R;

public class MenuActivity extends Activity{
	private static final String TAG = "_PlayMenuActivity";

	public static final String MENU_TYPE = "menu";
	public static final int MENU_PLAY = 1;
	public static final int MENU_RECORD = 2;
	public static final int MENU_SETTING = 3;
	
	int menuType;
	FragmentManager fm;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_menu);
		
		menuType = getIntent().getIntExtra(MENU_TYPE, 0);
		
		fm = getFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		
		switch(menuType){
		case MENU_PLAY:
			ft.add(R.id.menu_container, new PlayMenuFragment());
			break;
		case MENU_SETTING:
			ft.add(R.id.menu_container, new SettingMenuFragment());
			break;
		case MENU_RECORD:
			ft.add(R.id.menu_container,new RecordMenuFragement());
			break;
		default:
			finish();
		}
		
		ft.commit();

	}
}
